#include <iostream>
#include <string>

#include "TestNumber.h"
#include "TestArray.h"
//#include "TestVector.h"
//#include "TestMatrix.h"
//#include "TestFunction.h"
//#include "TestEquation.h"
//#include "TestFitting.h"
//#include "TestOptimizing.h"
//#include "TestGeometry.h"

using namespace typl;

void printMenu();
void printPrompt();

int main()
{
    printMenu();
    printPrompt();
    char choice;
    TestNumber testNumber;
    TestArray testArray;
    //TestMatrix testMatrix;
    //TestFitting testFitting;
    while (1)
    {
        std::cin >> choice;
        switch (choice)
        {
        case 'a':
            testNumber.run();
            break;
        case 'b':
            testArray.run();
            break;
        case 'c':
            //testVector.run();
            break;
        case 'd':
            //testMatrix.run();
            break;
        case 'e':
            //testFunction.run();
            break;
        case 'f':
            //testEquation.run();
            break;
        case 'g':
            //testFitting.run();
            break;
        case 'h':
            //testOptimizing.run();
            break;
        case 'i':
            //testGeometry.run();
            break;
        default:
            printMenu();
            break;
        }
        printPrompt();
    }

    return 0;
}

void printMenu()
{
    std::cout << "*************************" << std::endl
              << "      YPL Test Menu      " << std::endl
              << "                         " << std::endl
              << " [Module]          [Key] " << std::endl
              << "  Number             a   " << std::endl
              << "  Array              b   " << std::endl
              << "  Vector             c   " << std::endl
              << "  Matrix             d   " << std::endl
              << "  Function           e   " << std::endl
              << "  Equation           f   " << std::endl
              << "  Fitting            g   " << std::endl
              << "  Optimising         h   " << std::endl
              << "  Geometry           i   " << std::endl
              << "-------------------------" << std::endl
              << "  Quit               Q   " << std::endl
              << "*************************" << std::endl;
}

void printPrompt()
{
    const std::string prompt = "yplTest>";
    std::cout << prompt;
}
